import Translations from '@/components/bpmn/translate/Translations';

export default function customTranslate(template: string, replacements: any) {
    replacements = replacements || {};

    // Translate
    // @ts-ignore
    template = Translations[template] || template;

    // Replace
    return template.replace(/{([^}]+)}/g, function(_, key) {
        return replacements[key] || '{' + key + '}';
    });
}
